package com.central.game.dao;

import com.central.game.model.ResourceInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;
import java.util.Map;

@Mapper
public interface ResourceDao {

    int resourceCount(Map<String, Object> params);

    List<ResourceInfo> findResourceList(Map<String, Object> params);

    @Update("update config_resource set version = #{version}, sysId = #{sysId}, downUrl = #{downUrl}, code = #{code} where id = #{id}")
    void updateResource(ResourceInfo resourceInfo);

//    @Options(useGeneratedKeys = true, keyProperty = "id")
    @Insert("insert into config_resource(version,sysId,downUrl,code) values(#{version},#{sysId},#{downUrl},#{code})")
    void saveResource(ResourceInfo resourceInfo);

    @Delete("DELETE FROM config_resource WHERE id = #{id}")
    void delResource(Long id);
}
